package com.yyz.zjjcms.model;

import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * CmsTabValue entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "cms_tab_value", catalog = "zjjcms")
public class CmsTabValue implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -5534856969310375591L;
	private String id;
	private CmsTab cmsTab;
	private User modifyUser;
	private User newUser;
	private Timestamp newDate;
	private Timestamp modifyDate;

	// Constructors

	/** default constructor */
	public CmsTabValue() {
	}

	/** minimal constructor */
	public CmsTabValue(String id, CmsTab cmsTab, User modifyUser,
			User newUser) {
		this.id = id;
		this.cmsTab = cmsTab;
		this.modifyUser = modifyUser;
		this.newUser = newUser;
	}

	/** full constructor */
	public CmsTabValue(String id, CmsTab cmsTab, User modifyUser,
			User newUser, Timestamp newDate, Timestamp modifyDate) {
		this.id = id;
		this.cmsTab = cmsTab;
		this.modifyUser = modifyUser;
		this.newUser = newUser;
		this.newDate = newDate;
		this.modifyDate = modifyDate;
	}

	// Property accessors
	@Id
	@Column(name = "Id", nullable = false, length = 36)
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "org.hibernate.id.UUIDGenerator")
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "cms_tab_id", nullable = false)
	public CmsTab getCmsTab() {
		return this.cmsTab;
	}

	public void setCmsTab(CmsTab cmsTab) {
		this.cmsTab = cmsTab;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "modify_user_id", nullable = false)
	public User getModifyUser() {
		return this.modifyUser;
	}

	public void setModifyUser(User modifyUser) {
		this.modifyUser = modifyUser;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "new_user_id", nullable = false)
	public User getNewUser() {
		return this.newUser;
	}

	public void setNewUser(User newUser) {
		this.newUser = newUser;
	}
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	@Column(name = "new_date", length = 19)
	public Timestamp getNewDate() {
		return this.newDate;
	}

	public void setNewDate(Timestamp newDate) {
		this.newDate = newDate;
	}
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	@Column(name = "modify_date", length = 19)
	public Timestamp getModifyDate() {
		return this.modifyDate;
	}

	public void setModifyDate(Timestamp modifyDate) {
		this.modifyDate = modifyDate;
	}

}